class Banner < ActiveRecord::Base

  mount_uploader :img, ImageUploader

  validates :img, presence: true

  scope :index, -> { where(category: 'index') }

  scope :post, -> { where(category: 'post') }

  scope :job, -> { where(category: 'job') }

  scope :product, -> { where(category: 'product') }

  scope :description, -> { where(category: 'description') }

  scope :service, -> { where(category: 'service') }

  scope :customer, -> { where(category: 'customer') }

  scope :partner, -> { where(category: 'partner') }

  scope :contact, -> { where(category: 'contact') }

  scope :category, -> (category) { where(category: category) }

end
